package cn.com.zhangwoo.microstar.clothing.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import cn.com.microstar.activity.R;
import cn.com.zhangwoo.microstar.http.ImageLoader;
import cn.com.zhangwoo.microstar.http.ImageLoader.Type;
import cn.com.zhangwoo.microstar.http.VolleySingleton;
/***
 * 
 * @author Administrator
 *女装适配器
 */
public class LadiesGridViewAdapter extends BaseAdapter {

	private LayoutInflater inflater;
	private ImageLoader imageLoder0;//图片加载工具
	private int[]  listData;
	private Context context;
	private com.android.volley.toolbox.ImageLoader mImageLoader;
	public LadiesGridViewAdapter(Context context,int[]  listData) {
		this.inflater=LayoutInflater.from(context);
		this.listData=listData;
		this.context=context;
		imageLoder0 = ImageLoader
				.getInstance(3, Type.LIFO);
		mImageLoader=VolleySingleton.getVolleySingleton(context).getImageLoader();
	}

	@Override
	public int getCount() {
		return 9;
	}

	@Override
	public Object getItem(int position) {
		//TODO Auto-generated method stub
		return listData[position];
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (null==convertView) {
			holder=new ViewHolder();
			convertView=inflater.inflate(R.layout.item_ladies_gridview, null);
			holder.mImageView=(ImageView) convertView.findViewById(R.id.item_ladies_image);
			convertView.setTag(holder);
		}
		else
		{
			holder=(ViewHolder) convertView.getTag();
		}
		//holder.mImageView.setImageResource(listData[position]);
			//mImageLoader.get(listDataa[position], 
				//	com.android.volley.toolbox.ImageLoader.getImageListener(mImageView,R.drawable.zhangwo_hometop2, R.drawable.zhangwo_hometop2));
		
		return convertView;
	}
	
	
	class ViewHolder
	{
		TextView mTextView;
		ImageView mImageView;
	}

}
